from typing import List

from pydantic import Field

from common.base_models import InfectionMonkeyBaseModel
from common.types import NetworkPort


class Log4ShellOptions(InfectionMonkeyBaseModel):
    target_ports: List[NetworkPort] = Field(
        default=[8000, 8080, 8983, 9600],
        description="A list of HTTP ports that the Log4Shell exploiter will try to exploit.",
    )
    try_all_discovered_http_ports: bool = Field(
        default=False,
        description=(
            "Attempt to exploit Log4Shell on all HTTP ports discovered from network scanning."
        ),
    )
    exploit_download_timeout: float = Field(
        gt=0.0,
        default=5.0,
        description="The maximum time (in seconds) to wait for the victim to download the exploit.",
    )
    agent_binary_download_timeout: float = Field(
        gt=0.0,
        default=15.0,
        description=(
            "The maximum time (in seconds) to wait for a successfully exploited server to download "
            "the agent binary."
        ),
    )
